package com.ruoyi.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.business.param.LabCountXmlParam;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 实验项目管理对象 experiment_project
 * 
 * @author qiancheng
 * @date 2025-06-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("experiment_project")
public class ExperimentProject extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 实验项目ID */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 实验名称 */
    @Excel(name = "实验名称")
    @TableField(value = "experiment_name")
    private String experimentName;

    /** 实验时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实验时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField(value = "experiment_time")
    private Date experimentTime;

    /** 开始时间 */
    @TableField(value = "start_time")
    private String startTime;

    /** 结束时间 */
    @TableField(value = "end_time")
    private String endTime;

    /** 实验人员 */
    @Excel(name = "实验人员")
    @TableField(value = "experiment_person")
    private String experimentPerson;

    /** 实验结果：1-已上传，2-未上传 */
    @Excel(name = "实验结果：1-已上传，2-未上传")
    @TableField(value = "result_status")
    private Integer resultStatus;

    /** 所属台架ID */
    @Excel(name = "所属台架ID")
    @TableField(value = "rack_id")
    private Long rackId;

    /**
     * 所属台架名称
     */
    @TableField(exist = false)
    private String rackName;

    /** 所属年份 */
    @TableField(exist = false)
    private Integer belongYear;

    /** 所属月份 */
    @TableField(exist = false)
    private Integer belongMonth;

    /** 所属图纸 */
    @Excel(name = "所属图纸")
    @TableField(value = "draw")
    private String draw;

    /** 所属实验台id */
    @TableField(exist = false)
    private Long labId;

    public ExperimentProject(LabCountXmlParam labCountXmlParam) {
        this.belongMonth=labCountXmlParam.getBelongMonth();
        this.belongYear=labCountXmlParam.getBelongYear();
    }

}
